/*
 * @Descripttion: 
 * @version: 
 * @Author: guangyunl
 * @Date: 2024-03-09 02:34:45
 * @LastEditors: guangyunl
 * @LastEditTime: 2024-03-09 22:43:08
 */
// 轮播图接口文件

'use strict';
const { Controller } = require('egg');

class cCarousels extends Controller {

    //轮播图查询
    async pc_c_query_carousels() {
        const { ctx } = this;
        const result = await ctx.service.sCarousels.pc_s_query_carousels(ctx?.query ?? {});
        ctx.body = result;
    }

    //轮播图新增
    async pc_c_create_carousels() {
        const { ctx } = this;
        const result = await ctx.service.sCarousels.pc_s_create_carousels(ctx?.request?.body ?? {});
        ctx.body = result;
    }

    //轮播图新增
    async pc_c_update_carousels() {
        const { ctx } = this;
        const result = await ctx.service.sCarousels.pc_s_update_carousels(ctx?.request?.body ?? {});
        ctx.body = result;
    }

    //轮播图删除
    async pc_c_delete_carousels() {
        const { ctx } = this;
        const result = await ctx.service.sCarousels.pc_s_delete_carousels(ctx?.query ?? {});
        ctx.body = result;
    }

    /**
     * @Author: huangzb
     * @Date: 2024-03-12 17:38:09
     * @description: 小程序端【获取轮播图数据】
     * @return {*}
     */    
    async wa_c_queryCarousels () {
      const { ctx } = this;
      const result = await ctx.service.sCarousels.wa_s_queryCarousels(ctx?.query ?? {});
      ctx.body = result;
    }
}

module.exports = cCarousels;